package com.mall.order.config;

import com.zaxxer.hikari.util.UtilityElf;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

@Configuration
public class MyThreadPoolConfig {
    @Bean
    public ThreadPoolExecutor threadPoolExecutor(){
        return new ThreadPoolExecutor(
                10,
                50,
                100,
                TimeUnit.SECONDS,
               new ArrayBlockingQueue<>(100),
                Executors.defaultThreadFactory(),
               new ThreadPoolExecutor.AbortPolicy()

        );
    }
}
